import React, { Component } from 'react';
import '../styles/MySwiper.css'
import { Swiper } from 'antd-mobile';
import PropTypes from 'prop-types'

class MySwiper extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <div className='my-swiper'>
                <Swiper loop autoplay autoplayInterval={1000}>
                    {
                        this.props.swiperlist.map((item,index)=>{
                            return (
                                <Swiper.Item key={index}>
                                    <img src={item.pic} alt="" />
                                </Swiper.Item>
                            )
                        })
                    }
                </Swiper>
            </div>
        );
    }
}


// MySwiper.propTypes = {
//     swiperlist: { type: PropTypes.array }
// }

export default MySwiper;